import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index/index.vue'
import Category from '../views/category/category.vue'
import Home from '../components/Home/Home'

Vue.use(VueRouter)

const routes = [


  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views/login/login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      {
        path: '/index',
        name: 'Index',
        component: Index
      },
      {
        path: '/category',
        name: 'Category',
        component: Category
      },
	  {
	    path: '/product',
	    name: 'Product',
	    component: () => import(/* webpackChunkName: "about" */ '../views/product/product')
	  },
      {
        path: '/user',
        name: 'User',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/user')
      },
	  {
	    path: '/lend',
	    name: 'Lend',
	    component: () => import(/* webpackChunkName: "about" */ '../views/lend/lend')
	  },
	  {
	    path: '/permission',
	    name: 'Permission',
	    component: () => import(/* webpackChunkName: "about" */ '../views/permission/permission')
	  },
	  {
	    path: '/status',
	    name: 'Status',
	    component: () => import(/* webpackChunkName: "about" */ '../views/status/status')
	  },
	  {
	    path: '/repair',
	    name: 'Repair',
	    component: () => import(/* webpackChunkName: "about" */ '../views/repair/repair')
	  },
      {
        path: '/user_add_or_update',
        name: 'UserAddOrUpdate',
        component: () => import(/* webpackChunkName: "about" */ '../views/userAddOrUpdate/userAddOrUpdate')
      }
    ]
  },



]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
